#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import bs4
import requests
from bs4 import BeautifulSoup


class Bs4_v1:
    """
    请求url，返回bs4对象
    """
    headers = {
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42",
        'Cookie': "qcc_did=fdf4d693-8da7-4b4e-a037-983cbcffbd7e; UM_distinctid=182a01525e14b6-04c3a14cf7378-4c322d7e-144000-182a01525e2758; "
                  "CNZZDATA1254842228=241922124-1660539941-%7C1660539941",
    }

    def __init__(self, name: str):
        self.text = None
        self.url_list = []
        self.url = name

    def get_text(self) -> str | None:
        url = self.url
        result = requests.get(url=url, headers=self.headers).text
        res_obj = BeautifulSoup(result, "lxml")
        return res_obj









